<?php
/**
 * Author: liqinglin
 * CreateTime: 2019-1-4 18:02
 * description:
 */

namespace app\admin\model;

use think\Model;

class DynamicErrorMessage extends Model
{
    protected $table = 'cn_service_dynamic_error_message';

    public static function saveErrorMessage($error_message, $dynamic_id)
    {
        foreach ($error_message as $key=> $value) {
            $insert_data[] = ['message' => $value['value'], 'dynamic_id' => $dynamic_id, 'is_del' => 0];
        }
        self::where('dynamic_id', $dynamic_id)->update(['is_del' => 1]);
        return self::insertAll($insert_data);
    }

}